<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	pageContext.setAttribute("path",path);
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<script type="text/javascript">
$(function(){
	$(".easyui-linkbutton").linkbutton({});
	$('#rolegroup_datagrid').datagrid({
		//fit:true, striped:true,
		pagination:true,
	    fitColumns:true,nowrap:false,noheader:true,
	    //height:500,
	    detailFormatter:function(index,row){   
	        return '<div style="padding: 5px" id="userData-' + index + '"></div>';   
	    },
	    columns:[[
	        {field:'group_name', title:'用户名', width:80},
	        {field:'action', title:'操作', width:20,   
	            formatter:function(value,row,index){
	            	var id = row.id ;
	            	var temp0 = '<a class="xg" href="javascript:void(0)" onclick="RoleGroup.openEditPermission('+index+',\''+id+'\')" >授权</a>&nbsp;&nbsp;';
	            	var temp1 = '<a class="xg" href="javascript:void(0)" onclick="RoleGroup.openEdit( '+index+',\''+row.group_name+'\')" >修改</a>&nbsp;&nbsp;';
	            	var temp2 = '<a class="del" href="javascript:void(0)" >删除</a>';
	            	return temp0+ temp1+temp2;
	        	}
	       	}
		]],
	    loader:function( param, dg_s, dg_e ){
	    	var form = $("form[name='role_search_form']");
	    	if(param){
		    	if( param.page ){
		    		form.find("[name='page']").val(param.page);
		    	}
		    	if( param.pageNumber ){
		    		form.find("[name='pageSize']").val(param.pageNumber);
		    	}
	    	}
	    	var op = {
	    		url:"${path}/sysmanage/rolegroup/rolegroup_datagrid/json",dataType:"json",type:"post",
	    		success:function(json){ dg_s(json); },
	    		error:function(){ dg_e(); }
	    	};
	    	form.ajaxSubmit(op);
	    }
	});	
});
</script>

<style>
.form input {
	vertical-align:middle;
}
.veralign_middle{
	vertical-align:middle;
}
</style>

<div style="">
	<div id="role_search_div" style="height:28px;padding:4px 0 0 0">
		<form name="role_search_form" action="" class="form" >
			<input name="page" value="1" type="hidden" />
			<input name="pageSize" value="20" type="hidden" />
			<span class="veralign_middle">关键字:</span>
			<input name="keyword" style="font-size:12px;padding:4px 0 2px 0" />
			<a href="#" class="easyui-linkbutton veralign_middle" iconCls="icon-search" onclick="$('#rolegroup_datagrid').datagrid('reload');" >搜索</a> 
		</form>
	</div>
	
	<table id="rolegroup_datagrid" title="角色列表" fitColumns="true" singleSelect="true"  >
	</table> 
	
</div>






